#include <gmlib/sm9/internal/sm9_field.h>
#include <stdexcept>
#include <cstring>

using namespace sm9::internal;

void test_sm9_fn_sqr()
{
    sm9_fn_t    a, c;
    std::uint8_t c_data[32];

    static std::uint8_t a0[32] = {0x03,0x6d,0x1e,0x48,0xf5,0x37,0x22,0xf5,0xd1,0xff,0xbd,0x14,0x8a,0x8e,0xa7,0x15,0x28,0x47,0x45,0x0e,0xe6,0xb4,0x02,0xa2,0x6f,0x8e,0x0f,0xba,0xc3,0xb3,0x25,0xef};
    static std::uint8_t c0[32] = {0x47,0xe1,0xf8,0xa5,0xaa,0xe0,0xac,0xf1,0x6d,0xa2,0xa2,0xcc,0x35,0x36,0xa9,0xcf,0x2f,0x73,0x1a,0x3c,0x47,0x62,0x41,0x82,0xf3,0xc2,0x68,0xce,0x8f,0x54,0x1a,0x87};
    sm9_fn_from_bytes(a, a0);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c0, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a1[32] = {0x19,0x6d,0xf9,0x6f,0xe9,0xdb,0xc1,0x76,0x3e,0x76,0xf2,0xd4,0x4b,0xae,0xb8,0x94,0x4c,0x71,0xff,0xf7,0x99,0xf8,0x32,0xb4,0x65,0x4f,0xaf,0x0f,0xf0,0x6a,0x22,0xae};
    static std::uint8_t c1[32] = {0x87,0xd1,0x2c,0x58,0x13,0x71,0x95,0xab,0x0c,0x0b,0x55,0x79,0x91,0xf3,0xaf,0x09,0xa5,0x34,0x18,0xe9,0x4f,0x2a,0xf9,0x7a,0x85,0xfd,0x8b,0xd4,0x45,0xff,0xe9,0xe7};
    sm9_fn_from_bytes(a, a1);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c1, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a2[32] = {0xaf,0xb6,0x95,0xd3,0xa3,0xe7,0xee,0x8e,0x6c,0x30,0x70,0xf7,0xc9,0x28,0xfa,0xe7,0x71,0xf7,0xf2,0x4c,0x73,0xb4,0x37,0xae,0x9d,0xcf,0x46,0x6e,0x44,0xb9,0x45,0xbb};
    static std::uint8_t c2[32] = {0x5a,0xc0,0x2e,0x16,0x43,0xbc,0x0d,0xe8,0x2d,0xc4,0x55,0x30,0x2f,0xe7,0x49,0xf9,0xb6,0xb9,0x72,0x2c,0x3f,0xd2,0x92,0xeb,0x30,0xf6,0xbc,0x4b,0x47,0xe5,0xa1,0xda};
    sm9_fn_from_bytes(a, a2);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c2, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a3[32] = {0x0b,0x0d,0x1d,0xc8,0xdd,0x6f,0x9c,0x93,0x28,0x44,0xc6,0x93,0x6d,0x34,0xed,0xc9,0x2d,0x16,0x3c,0x3b,0xa5,0xc9,0xfa,0xf5,0x63,0x9f,0x21,0x9c,0x8b,0xdf,0xf6,0xbf};
    static std::uint8_t c3[32] = {0xa0,0xc3,0x9a,0xc9,0xf4,0x2f,0x09,0x47,0x48,0x8d,0x64,0xe6,0xaa,0xcc,0xc7,0xd6,0xac,0x64,0xe4,0xd8,0xaa,0x3f,0x6c,0x58,0x31,0x8e,0x35,0x96,0xe1,0xc1,0x76,0xa6};
    sm9_fn_from_bytes(a, a3);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c3, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a4[32] = {0x04,0x31,0x4f,0xd8,0x38,0xd9,0xed,0x16,0x5d,0x48,0x80,0xda,0xf2,0x62,0x1d,0xa7,0x9f,0x57,0x75,0x22,0x33,0x2c,0x51,0x9b,0x87,0xe8,0xbd,0x36,0x71,0x44,0x08,0x55};
    static std::uint8_t c4[32] = {0x63,0x58,0x42,0x5b,0xe3,0xf7,0x6a,0xef,0xbc,0x45,0x3d,0x98,0xaf,0x37,0x51,0x79,0x0a,0x76,0x6b,0xc5,0x82,0x65,0x02,0x2d,0xc0,0xbb,0x39,0xce,0x8e,0xbd,0x90,0xfa};
    sm9_fn_from_bytes(a, a4);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c4, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a5[32] = {0x09,0x1e,0x90,0x27,0xce,0x8e,0x96,0x85,0x85,0x43,0x23,0x7b,0x80,0x84,0xec,0x25,0x41,0x1d,0x22,0x7f,0x54,0x62,0x19,0x3c,0x82,0x8d,0x83,0xf1,0xd9,0x05,0xd1,0xad};
    static std::uint8_t c5[32] = {0x41,0x55,0xe4,0xa2,0x26,0x39,0xbc,0x06,0xe3,0xc0,0x7b,0x62,0xe3,0x81,0x20,0x52,0x26,0xa5,0x48,0xbe,0x29,0x4d,0xd6,0x6d,0x2a,0xbd,0x7c,0xcc,0x40,0x23,0x96,0x76};
    sm9_fn_from_bytes(a, a5);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c5, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a6[32] = {0x2c,0x16,0xd0,0xb0,0x28,0x57,0xa9,0xad,0xe8,0xba,0x48,0xd0,0x80,0xa5,0x31,0x21,0x54,0x36,0x4d,0x9c,0x3e,0x5e,0xdc,0x1b,0x42,0xaa,0xa9,0xa6,0xa8,0x4c,0x6d,0xa3};
    static std::uint8_t c6[32] = {0x21,0x78,0x9a,0x22,0xa7,0xac,0xd7,0x61,0xa7,0x7a,0x16,0x45,0x58,0x02,0xac,0x6d,0xe6,0x66,0x93,0xff,0x42,0x29,0xc2,0xd5,0x65,0xa1,0x72,0xc1,0x3d,0x44,0x24,0x45};
    sm9_fn_from_bytes(a, a6);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c6, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a7[32] = {0x13,0xec,0x26,0x51,0x3a,0xfa,0x68,0xb8,0x09,0x1a,0x25,0x95,0xc8,0xfb,0x93,0xd4,0x03,0x76,0xc3,0xc0,0xdc,0xb0,0xb1,0x1c,0xca,0x55,0x67,0xf5,0x97,0x3c,0x8c,0xe3};
    static std::uint8_t c7[32] = {0x16,0x0b,0x59,0xb4,0x0a,0x3c,0x37,0x55,0x2f,0x12,0x36,0xdc,0xfe,0x93,0x8e,0x40,0xec,0xd7,0xc5,0xa6,0xa9,0xeb,0xe1,0x0c,0x5a,0x19,0xc1,0x82,0x83,0x36,0xef,0xd4};
    sm9_fn_from_bytes(a, a7);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c7, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a8[32] = {0x0c,0x74,0x3f,0xba,0x5d,0xa2,0xf2,0xdc,0xf3,0xd5,0x78,0xe0,0x1f,0xd9,0x20,0x7e,0xfd,0x45,0x88,0x3b,0xc8,0x68,0x88,0xdc,0x34,0x89,0x8c,0x6b,0x19,0x77,0x1a,0x3d};
    static std::uint8_t c8[32] = {0x34,0xa0,0x36,0x80,0xa1,0x80,0x12,0x9f,0x85,0xa2,0xbc,0x29,0x0a,0xbd,0x76,0x63,0x9b,0xba,0xff,0x72,0x7e,0x5d,0xd6,0xe7,0xc9,0x64,0x17,0x7a,0x40,0xc3,0xbf,0x1b};
    sm9_fn_from_bytes(a, a8);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c8, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a9[32] = {0x30,0xe3,0x83,0xd5,0x85,0x52,0x06,0xef,0xa3,0x63,0xab,0x2f,0x51,0x00,0x05,0x6d,0x7e,0x6c,0x1c,0x84,0xce,0x29,0xc1,0xc8,0xe8,0xf1,0xd1,0xbc,0x50,0x64,0x62,0x07};
    static std::uint8_t c9[32] = {0x0c,0x92,0xdf,0xd0,0xf1,0xf0,0x8e,0x75,0x84,0x5d,0xcb,0x06,0xad,0x7c,0x19,0xe9,0x07,0xbe,0xcc,0x60,0xc5,0x41,0x78,0x64,0x6c,0x44,0x3c,0x3f,0x3d,0xde,0xd0,0x0c};
    sm9_fn_from_bytes(a, a9);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c9, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a10[32] = {0x16,0x63,0xd1,0x6c,0xef,0x62,0x4b,0x7c,0xd2,0x7d,0x14,0x46,0xe3,0x38,0xa0,0x36,0x04,0xca,0xd5,0xa1,0xbf,0x84,0xb2,0x25,0xba,0x39,0x74,0x27,0x5a,0xd5,0x9c,0x8e};
    static std::uint8_t c10[32] = {0x60,0x0e,0xdb,0x5f,0x59,0xc1,0x37,0x4f,0x2a,0x09,0xad,0x72,0x70,0xc9,0x92,0x60,0xfe,0xe7,0x4b,0xce,0x4e,0x7a,0x49,0xee,0x80,0xbe,0x1b,0xc5,0x9e,0x64,0x58,0x90};
    sm9_fn_from_bytes(a, a10);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c10, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a11[32] = {0x38,0x7a,0xb0,0x02,0xe0,0x7d,0xac,0x8f,0xa4,0x20,0xfb,0x49,0x99,0x1f,0x76,0x11,0x64,0x32,0x43,0x4e,0xc8,0x5d,0x58,0x7b,0x97,0x4d,0x72,0x68,0xd0,0x5f,0x2b,0xd7};
    static std::uint8_t c11[32] = {0x30,0x39,0x82,0x5c,0x1e,0x8b,0x42,0xeb,0xbb,0x1c,0x62,0x26,0x52,0x6b,0x59,0x67,0xe2,0x11,0x0f,0x37,0x6c,0x72,0x24,0x89,0x50,0xae,0xbf,0x4b,0xf9,0xa8,0x35,0xf4};
    sm9_fn_from_bytes(a, a11);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c11, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a12[32] = {0x2f,0xdb,0x67,0x4a,0xcf,0x99,0xda,0x4c,0xab,0x2d,0x68,0x31,0xe1,0xde,0x32,0xff,0xf6,0xf0,0x5d,0x17,0x81,0x05,0xa3,0xf6,0x91,0x7d,0x74,0xba,0x50,0xc8,0x3a,0xaa};
    static std::uint8_t c12[32] = {0x1b,0x29,0xfa,0x01,0xf8,0x79,0xc8,0x9e,0x37,0x6d,0x5a,0xe9,0xc0,0x08,0xd1,0x16,0x52,0x85,0xc0,0x31,0xfe,0xf7,0x98,0x52,0xf7,0x02,0x45,0x24,0xf3,0x9f,0xe9,0xc3};
    sm9_fn_from_bytes(a, a12);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c12, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a13[32] = {0xa8,0xc5,0xc7,0x69,0x18,0x8a,0x6c,0x7e,0xb2,0xc1,0x02,0xa3,0x22,0x75,0xcc,0xb7,0xbf,0x0b,0x9d,0xce,0x8b,0x06,0x41,0xfa,0xd4,0xc1,0x27,0x0b,0x93,0x27,0xe9,0xed};
    static std::uint8_t c13[32] = {0x37,0x01,0xdf,0x6f,0xaf,0xba,0xfd,0x30,0xd2,0x4f,0x6f,0xbf,0x8c,0x50,0x31,0x77,0x60,0xed,0xff,0x66,0x44,0x92,0xd6,0xbc,0xc2,0x56,0xe1,0x00,0x6a,0x75,0x4a,0xf6};
    sm9_fn_from_bytes(a, a13);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c13, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a14[32] = {0x03,0x84,0x5c,0x19,0x29,0x4d,0x38,0xc8,0x69,0x52,0x5f,0x94,0xbd,0xa5,0xd2,0x6c,0xda,0x4a,0xb1,0x95,0x79,0xd3,0x49,0xca,0xb8,0xa9,0x89,0xf3,0x34,0x3c,0x15,0xa3};
    static std::uint8_t c14[32] = {0xb1,0x43,0x33,0xe8,0xc5,0x4a,0x95,0xc2,0xe4,0xc9,0x27,0xbb,0x16,0x57,0x8a,0x4b,0x6e,0x10,0x83,0x34,0x04,0x56,0x4a,0xdd,0x2e,0x3b,0x1d,0x45,0x8e,0x5a,0x44,0xc9};
    sm9_fn_from_bytes(a, a14);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c14, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a15[32] = {0x33,0x68,0x99,0x35,0xc7,0x9d,0x92,0x22,0x28,0x5b,0x74,0xbd,0x68,0xba,0x07,0x3c,0x2e,0x27,0x7e,0xbd,0xbe,0x33,0x8a,0x2b,0x67,0x9a,0x86,0xf4,0xb5,0xae,0xd9,0x96};
    static std::uint8_t c15[32] = {0x80,0xeb,0xe8,0x49,0xfb,0x26,0xd9,0x0c,0x79,0xa4,0x0c,0x7a,0xad,0x1a,0x0d,0x67,0x75,0x7a,0xfd,0xf6,0xbd,0x9e,0x58,0x46,0x4e,0x7c,0x4a,0x81,0x70,0x24,0xe8,0xe1};
    sm9_fn_from_bytes(a, a15);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c15, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a16[32] = {0x9b,0x8c,0x4a,0xcd,0x9d,0x18,0xff,0x28,0x90,0xc5,0xad,0x08,0x31,0xcd,0x71,0x2f,0x10,0x76,0x36,0x89,0x11,0xde,0xc3,0x4b,0xfd,0xeb,0x06,0x81,0x48,0xb3,0x3f,0xbc};
    static std::uint8_t c16[32] = {0x6c,0x0f,0xa0,0xab,0x3e,0xe1,0x44,0x97,0xd0,0x5f,0x87,0x3d,0xad,0x0b,0xa0,0xc3,0x5f,0xcb,0xd4,0x04,0x62,0xe8,0xcb,0x31,0xf2,0xe7,0x39,0x97,0xfd,0xbe,0x6a,0x8a};
    sm9_fn_from_bytes(a, a16);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c16, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a17[32] = {0x31,0xc4,0x33,0x4e,0xde,0xb2,0x38,0x51,0xfe,0x85,0x0d,0xe9,0xe1,0xf9,0x7b,0x0f,0x5e,0xad,0x97,0xd7,0xa0,0x57,0x62,0xf7,0x35,0x58,0x60,0xa1,0x80,0x79,0x80,0x83};
    static std::uint8_t c17[32] = {0x4e,0xe6,0xbd,0x0f,0x5b,0x5d,0x82,0x68,0x80,0x34,0x0e,0x0e,0x17,0x2a,0x32,0x03,0x87,0x82,0x1c,0x48,0x93,0xe2,0xe6,0x52,0x3b,0x01,0x4f,0x0c,0x4d,0x2e,0x5f,0x85};
    sm9_fn_from_bytes(a, a17);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c17, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a18[32] = {0x05,0x85,0xb4,0xce,0xd6,0xcf,0x89,0x7e,0xbc,0x6f,0xbb,0x7d,0x53,0x9b,0x46,0xdd,0x61,0x92,0xb7,0xca,0x83,0x7b,0x74,0x45,0xd3,0x65,0x0a,0xe9,0xb7,0x6d,0xe9,0x42};
    static std::uint8_t c18[32] = {0x43,0x78,0x89,0x70,0x18,0x7f,0xd4,0x43,0xb6,0x21,0x44,0x0c,0x79,0xaa,0xf3,0x15,0x3e,0x92,0x33,0x5f,0x60,0x7e,0xca,0x95,0xbd,0xfd,0x86,0x45,0xf0,0x87,0x06,0x0c};
    sm9_fn_from_bytes(a, a18);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c18, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a19[32] = {0x42,0x78,0xdd,0xfc,0x2a,0x3a,0x1c,0x3a,0xbc,0xce,0x57,0x8b,0x1c,0x69,0x7f,0xf0,0xfd,0x0b,0x62,0x28,0x6e,0xfc,0xb2,0xf0,0x01,0x6c,0xf8,0x10,0x7f,0x97,0x0f,0xb7};
    static std::uint8_t c19[32] = {0x52,0x98,0xd1,0x79,0x9d,0x1d,0x05,0x06,0x9d,0x12,0x76,0xde,0xaa,0xd5,0xb1,0x64,0xcb,0xe9,0x31,0x77,0x0c,0xcf,0x3c,0x79,0x9b,0xc6,0x80,0x71,0xdc,0xa6,0xec,0x18};
    sm9_fn_from_bytes(a, a19);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c19, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a20[32] = {0x24,0xf5,0x67,0x73,0x94,0x45,0x73,0x8c,0x59,0xfc,0x0c,0xfa,0xbf,0x51,0x97,0x0d,0x54,0xbd,0x47,0xda,0x67,0x8e,0xc2,0xb7,0x4a,0x53,0xe8,0x7b,0x28,0x5f,0xd2,0x50};
    static std::uint8_t c20[32] = {0x62,0x91,0x47,0x6e,0xe4,0x1b,0x16,0xfe,0x0e,0x79,0x97,0x0a,0xc1,0x78,0x2f,0x54,0x97,0x45,0xe1,0x4e,0x34,0x10,0xbc,0xc8,0x39,0x33,0x27,0x1a,0xcc,0xf2,0xf4,0x77};
    sm9_fn_from_bytes(a, a20);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c20, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a21[32] = {0x69,0xc2,0x42,0x3e,0x66,0x81,0xc2,0x37,0x54,0x0f,0x71,0x3d,0xdc,0xb6,0x00,0xd1,0x3b,0x9e,0x20,0x4f,0x12,0x53,0x4e,0xcf,0x63,0xcc,0x8e,0x03,0x65,0xae,0xc9,0x9f};
    static std::uint8_t c21[32] = {0x58,0x5a,0xc3,0x13,0xf8,0x6c,0xde,0xc2,0xa5,0x45,0x33,0xcf,0x1c,0x7b,0xb5,0x12,0x3e,0x64,0xdd,0x48,0xbc,0x82,0xf5,0x1f,0x25,0x1e,0x63,0xb7,0x31,0xd8,0x44,0xdd};
    sm9_fn_from_bytes(a, a21);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c21, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a22[32] = {0x1e,0x02,0x2c,0xe3,0x52,0xcd,0x89,0x71,0x12,0xad,0xae,0x84,0x0c,0x4a,0xd4,0x66,0x18,0x68,0xbc,0xde,0x4d,0x79,0x0d,0x43,0x79,0x52,0xb4,0x8a,0x0b,0xea,0x44,0x5b};
    static std::uint8_t c22[32] = {0x7d,0xe1,0xe8,0x3e,0x13,0xbe,0x9a,0x8a,0x6f,0x01,0xa5,0x25,0xcf,0x37,0x75,0x7a,0x74,0xdd,0x27,0x5c,0x8c,0xb3,0xef,0x94,0x4c,0x4e,0xf0,0x39,0x78,0x23,0x44,0x51};
    sm9_fn_from_bytes(a, a22);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c22, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a23[32] = {0x13,0xe5,0xb1,0x2c,0xca,0x3b,0x80,0xfb,0xa3,0xca,0x0f,0x20,0xd2,0x09,0x0d,0x62,0xf4,0xdb,0xdf,0x7d,0x30,0x98,0x57,0xef,0x72,0x78,0x51,0x09,0xfc,0xbf,0x14,0x84};
    static std::uint8_t c23[32] = {0x1a,0x9e,0xc7,0xac,0x13,0x51,0x23,0x13,0xbc,0xf7,0x8e,0xfc,0xa0,0x71,0xf6,0x74,0x5e,0x3e,0xf7,0x2f,0xbb,0xa7,0xc1,0xf8,0x02,0xac,0xab,0x01,0x3d,0xba,0x84,0xcc};
    sm9_fn_from_bytes(a, a23);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c23, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a24[32] = {0x70,0xa6,0xbd,0x41,0xb6,0xbd,0x0b,0x79,0x8b,0xce,0x19,0x17,0x17,0x12,0x2b,0x76,0xf4,0x45,0xfc,0x94,0xfb,0xca,0x35,0x7f,0xbd,0x58,0x9b,0x3c,0xc3,0xec,0x45,0x30};
    static std::uint8_t c24[32] = {0xb0,0x05,0x11,0x97,0x61,0x49,0x4e,0xbb,0x2f,0xab,0x63,0x7a,0xec,0x22,0x2c,0x71,0x8d,0x22,0x12,0x7a,0x45,0x83,0xbf,0xa4,0xe1,0x0e,0x48,0x6f,0xda,0xec,0x30,0xd5};
    sm9_fn_from_bytes(a, a24);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c24, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a25[32] = {0x29,0xb9,0x8a,0x26,0x67,0x1d,0xa1,0xa8,0x14,0x4e,0x10,0x09,0xc7,0x89,0xd2,0x01,0x7c,0x49,0xb1,0x2e,0xf6,0xd1,0xcf,0xd8,0xd4,0xa6,0x40,0x5a,0x6a,0xee,0x0c,0x2b};
    static std::uint8_t c25[32] = {0x50,0xc7,0x9e,0x27,0x12,0xa3,0xbe,0x17,0xd2,0xc2,0x90,0x60,0x51,0x99,0x8a,0x6a,0xf7,0x77,0x83,0x91,0x15,0x36,0x85,0xb4,0xba,0xa8,0xa1,0x17,0x65,0x44,0xed,0xef};
    sm9_fn_from_bytes(a, a25);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c25, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a26[32] = {0x89,0x6b,0xdb,0x15,0xc1,0x4b,0xe8,0x73,0x14,0x0d,0x54,0x5e,0x78,0xf9,0xaf,0x6c,0x82,0x7b,0x69,0xd6,0xd8,0xb8,0xab,0xd1,0xa7,0x69,0xb4,0x11,0x02,0x36,0xa5,0x6b};
    static std::uint8_t c26[32] = {0x59,0xe7,0x7b,0x53,0x54,0x97,0xd1,0x41,0x9c,0x05,0xe9,0x42,0xc0,0xdb,0x7c,0xc9,0xfc,0x14,0x8c,0x2f,0xbf,0xde,0x9a,0x78,0x3d,0x57,0xef,0xff,0xdb,0x58,0xb3,0x22};
    sm9_fn_from_bytes(a, a26);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c26, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a27[32] = {0x9a,0xea,0x96,0xcc,0xa0,0x64,0xea,0x66,0x53,0xf6,0x15,0x2e,0x4c,0x31,0x1f,0x7f,0x74,0x67,0x4a,0xd3,0x54,0x24,0x98,0xb8,0x8a,0x74,0x93,0x9a,0xa4,0x1a,0x95,0x72};
    static std::uint8_t c27[32] = {0x67,0xdb,0xee,0x13,0xff,0x68,0x39,0x85,0x8c,0x80,0x85,0x56,0x82,0x1d,0x04,0x76,0x2e,0xf0,0xda,0x58,0x92,0x6b,0xe3,0x79,0x17,0xda,0x2a,0x20,0x1f,0xfa,0x2f,0xef};
    sm9_fn_from_bytes(a, a27);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c27, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a28[32] = {0x7f,0x64,0x2f,0xc3,0xf7,0xa4,0x7f,0x8b,0xd7,0xff,0x6c,0xc4,0xb5,0x23,0x22,0x0e,0x8d,0x7c,0xe1,0xcb,0x2f,0x45,0x68,0x5f,0xc2,0xf2,0xb7,0xf9,0xe2,0xdc,0xe9,0x17};
    static std::uint8_t c28[32] = {0x8c,0x90,0x72,0xef,0x13,0xdc,0xc1,0x9f,0x80,0x87,0x83,0x0a,0x99,0x97,0x0a,0x21,0x3c,0xe3,0x6b,0x81,0x15,0x36,0xd4,0x9d,0xe9,0xce,0xf8,0x66,0x28,0x00,0xf0,0xbb};
    sm9_fn_from_bytes(a, a28);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c28, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a29[32] = {0x1e,0x18,0xaa,0x28,0x74,0x6e,0x16,0x40,0x9c,0xc0,0x9a,0x4c,0x1e,0x14,0x47,0x3a,0xc7,0x01,0xc9,0xb4,0xa2,0x18,0x2b,0xd5,0xa3,0x1a,0x3b,0xb8,0x2f,0x0e,0x11,0xa0};
    static std::uint8_t c29[32] = {0x05,0xc6,0x13,0xd4,0x0d,0x85,0xdb,0xdb,0x29,0x1b,0x4e,0xb4,0x8d,0xee,0x44,0xc4,0x29,0xf9,0x25,0x5a,0x5b,0x72,0xac,0xba,0x60,0x94,0x96,0x11,0xbd,0x69,0xc1,0x88};
    sm9_fn_from_bytes(a, a29);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c29, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a30[32] = {0x3b,0x56,0x2a,0xff,0xd1,0xb5,0x32,0xe6,0x47,0x14,0x6a,0x33,0x39,0x60,0x0c,0x3a,0x30,0x41,0x94,0x43,0xb6,0xc3,0x23,0xa0,0x85,0x20,0x4d,0x3e,0xd8,0x1c,0xe2,0xab};
    static std::uint8_t c30[32] = {0x76,0x78,0x2c,0xe5,0xd5,0x2c,0x3c,0x5e,0xca,0x64,0xba,0x64,0x3c,0x7e,0xd3,0x72,0x48,0xc0,0x3f,0x44,0x2f,0xac,0x9c,0xd4,0x28,0xf3,0xd4,0x6c,0x68,0x7e,0xe1,0x6d};
    sm9_fn_from_bytes(a, a30);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c30, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a31[32] = {0x8b,0x1c,0xbf,0x25,0x4c,0xc2,0xdb,0xd0,0x64,0xfd,0xaf,0xef,0xe1,0x8e,0x66,0xf4,0x8d,0x88,0x2f,0x34,0x56,0x52,0xe0,0x3f,0xbe,0xc6,0xcc,0x01,0xdc,0x6a,0xc2,0xd3};
    static std::uint8_t c31[32] = {0x16,0xf5,0x22,0xce,0x78,0x8a,0x53,0x70,0xec,0xc2,0x63,0x5b,0xd5,0x86,0xa6,0x7d,0xed,0xab,0xa9,0xb4,0xa6,0x33,0xd2,0x73,0x5b,0x14,0xb3,0xd7,0x76,0x6d,0xe7,0x8d};
    sm9_fn_from_bytes(a, a31);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c31, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a32[32] = {0x11,0x3b,0x67,0x3d,0x19,0x19,0x90,0x26,0x64,0x11,0x16,0xff,0x8b,0xd3,0xc1,0xff,0xe8,0x79,0x6f,0xb6,0x8b,0x0e,0x0c,0x40,0xb5,0x91,0xa6,0x0c,0x0f,0xc5,0x38,0x5d};
    static std::uint8_t c32[32] = {0x55,0xf5,0xd6,0x3a,0x1a,0xc7,0x99,0x65,0x7e,0x6e,0x91,0x41,0xa1,0x9a,0x4c,0x9e,0x85,0x3f,0x24,0xab,0xb9,0x76,0x37,0x08,0x24,0x12,0x55,0xdf,0x1c,0x7a,0xf3,0xe1};
    sm9_fn_from_bytes(a, a32);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c32, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a33[32] = {0x27,0xd8,0x21,0xa7,0x71,0xbc,0x06,0x23,0x02,0x09,0xde,0x74,0x32,0xc6,0x4e,0xee,0x04,0xc8,0x24,0x4c,0x1a,0x48,0x52,0x4e,0x72,0x3e,0x75,0xca,0xfa,0x67,0x3c,0xb7};
    static std::uint8_t c33[32] = {0xad,0x05,0x8a,0x0a,0x11,0x57,0xbe,0xa6,0x0a,0xb2,0x13,0x85,0x8d,0x5d,0x99,0x5e,0x8b,0xfc,0x64,0x6c,0xcf,0x69,0xea,0x4c,0x3c,0xce,0xf5,0xed,0x83,0x41,0x53,0x93};
    sm9_fn_from_bytes(a, a33);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c33, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a34[32] = {0x61,0xaa,0x48,0x45,0xa1,0xca,0x7b,0x37,0x4a,0xf3,0x69,0xb3,0x32,0x75,0x69,0xcf,0x12,0xbb,0x23,0x9d,0xcb,0x6f,0x09,0xa8,0xaf,0xd5,0xb7,0x05,0xd7,0xf3,0x63,0x4a};
    static std::uint8_t c34[32] = {0x7a,0xa9,0xd7,0xfa,0x91,0xbd,0x55,0x9a,0x18,0x35,0xce,0x78,0x62,0x34,0x05,0xac,0xc4,0xf4,0x7c,0x5c,0x7e,0x0d,0xe0,0xf6,0x59,0xb7,0x94,0x61,0x3a,0x0a,0x32,0x23};
    sm9_fn_from_bytes(a, a34);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c34, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a35[32] = {0x62,0x75,0x85,0x25,0x8a,0x7b,0xef,0x1e,0x0b,0xf9,0x5d,0x03,0x69,0x40,0xf9,0x7f,0x60,0xe2,0x26,0xdf,0xcb,0x0e,0x08,0x44,0x11,0x47,0xd2,0x5d,0xd9,0xa2,0xe8,0xee};
    static std::uint8_t c35[32] = {0xb4,0xaf,0xc1,0xa7,0x41,0x8c,0x10,0x24,0x6d,0x5c,0xba,0x35,0x85,0xc4,0x19,0x62,0x7c,0x5a,0x5d,0x4b,0x9f,0x8d,0xfd,0x0d,0x5a,0xe5,0x7d,0xcf,0x79,0x85,0x0b,0x6a};
    sm9_fn_from_bytes(a, a35);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c35, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a36[32] = {0x03,0x9d,0xeb,0x37,0x35,0x48,0xec,0xe5,0x49,0x98,0x4d,0x47,0x15,0x8a,0x6d,0x60,0xac,0xfd,0xda,0xdb,0xf3,0x8f,0x14,0x9c,0x6b,0xb3,0xff,0x61,0x8e,0x9b,0x46,0x3f};
    static std::uint8_t c36[32] = {0x8e,0x1e,0x44,0x09,0xdc,0x7c,0xb8,0x25,0xfb,0x0c,0xa1,0x76,0x5a,0xf1,0x1b,0x74,0xc6,0x24,0x4a,0xe8,0xa3,0xb9,0x34,0x41,0x15,0x64,0x50,0x84,0x9e,0xbb,0xf8,0x0e};
    sm9_fn_from_bytes(a, a36);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c36, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a37[32] = {0x9c,0xa1,0xa7,0x38,0x9c,0x67,0x04,0xd6,0x8b,0xa8,0xb4,0xfe,0x35,0x88,0x5e,0x56,0x61,0x45,0x7b,0xe3,0x11,0xdf,0xef,0x05,0x7d,0x33,0xb7,0x16,0x31,0x22,0xc9,0xf0};
    static std::uint8_t c37[32] = {0x27,0x9d,0xdb,0x51,0xfc,0x1a,0xe6,0xfa,0x34,0x23,0x48,0xe1,0xbe,0x8f,0x4c,0x96,0x51,0xea,0xcc,0x9f,0xf7,0xf7,0x12,0xcb,0xf4,0x09,0x58,0x93,0x00,0xf7,0xb4,0xff};
    sm9_fn_from_bytes(a, a37);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c37, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a38[32] = {0x24,0x35,0x71,0x51,0x68,0x04,0x87,0x6c,0x65,0x54,0x93,0x6c,0x65,0x0a,0xb3,0xb2,0x46,0xe8,0x3c,0xa1,0x56,0x64,0x13,0xee,0x3d,0x7b,0x29,0x8c,0x56,0x9d,0x56,0x15};
    static std::uint8_t c38[32] = {0xa1,0xe9,0x1f,0x60,0x90,0x24,0x1f,0xee,0x51,0xc0,0x9b,0x4f,0x28,0xc5,0x79,0xb4,0x34,0xf6,0x6c,0x4b,0xf4,0xb9,0x6c,0x21,0x89,0xbb,0xba,0x11,0xab,0x8e,0xdb,0x46};
    sm9_fn_from_bytes(a, a38);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c38, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a39[32] = {0x84,0x50,0xbe,0x07,0x16,0x2f,0x71,0xbb,0xcf,0x67,0xb7,0xba,0x5f,0xfa,0x52,0xe2,0xce,0x3f,0x5d,0xe6,0x60,0xd3,0xad,0xf6,0x97,0x30,0xb6,0x93,0x31,0x68,0xa6,0x8b};
    static std::uint8_t c39[32] = {0x56,0x51,0xb2,0x78,0xea,0x17,0x54,0x7a,0x4f,0xe8,0x54,0x4c,0x8c,0xe2,0x6c,0x5d,0x45,0x4e,0xa8,0xcd,0x99,0xbf,0x7e,0x40,0x67,0xed,0x6b,0x10,0xa5,0x9c,0xf6,0xd8};
    sm9_fn_from_bytes(a, a39);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c39, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a40[32] = {0x64,0xa5,0x3f,0x82,0x17,0xcc,0xf6,0x9a,0x98,0x01,0x84,0x36,0xcd,0xed,0xc6,0xad,0xb4,0xc4,0x05,0x08,0x0e,0xae,0x66,0xb8,0x31,0xdd,0x3d,0x76,0xf2,0xca,0xdf,0x32};
    static std::uint8_t c40[32] = {0x8c,0x14,0xcb,0xc0,0xe6,0xbd,0xce,0xbb,0xbd,0x56,0x70,0x15,0xfd,0xa4,0xbf,0xda,0xd2,0xbd,0x8e,0x49,0x21,0xc7,0x7e,0x77,0xd1,0xa7,0x5e,0x5b,0x17,0x7d,0x01,0x77};
    sm9_fn_from_bytes(a, a40);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c40, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a41[32] = {0x27,0x09,0xc4,0x4b,0x89,0xad,0xbe,0x71,0x5c,0x38,0xaf,0x62,0xc7,0xff,0xc6,0xb4,0xc9,0x02,0xd8,0xba,0xc0,0xc1,0x9c,0xd9,0x49,0x6f,0x7d,0xec,0x7c,0x90,0x5b,0xea};
    static std::uint8_t c41[32] = {0xb3,0x5f,0x07,0xb7,0xc9,0xe1,0x07,0x1e,0x57,0x04,0x38,0x06,0x82,0xf1,0x83,0xda,0x56,0x45,0x07,0x77,0xd9,0x5a,0x90,0x75,0x21,0x3d,0x1c,0xce,0x9f,0x80,0xaf,0x74};
    sm9_fn_from_bytes(a, a41);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c41, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a42[32] = {0x13,0x0b,0x52,0xf7,0xe3,0x7d,0x6e,0x4f,0x2b,0xc0,0x03,0xd5,0xb2,0x43,0x7f,0xc3,0x9c,0x40,0x3d,0x9f,0xa9,0xaa,0x57,0xff,0xb2,0x8d,0x26,0xf5,0xe9,0x0a,0xc7,0xda};
    static std::uint8_t c42[32] = {0x9a,0x6e,0x17,0xb7,0x61,0xa6,0x0c,0x49,0x74,0x75,0x5e,0x22,0x14,0x66,0x7d,0xc7,0x97,0x1e,0xfa,0x42,0xc0,0x2c,0xe8,0xc9,0xbc,0xf3,0xeb,0xf2,0xe4,0x66,0xfc,0xbf};
    sm9_fn_from_bytes(a, a42);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c42, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a43[32] = {0x1b,0xff,0xf7,0xfc,0x06,0x10,0x6b,0x7a,0x98,0x0b,0x34,0x71,0x6e,0x7c,0xc6,0x5b,0xd3,0xf4,0x68,0x83,0x30,0xc7,0x3b,0xdb,0x24,0x0a,0x9c,0x8d,0xb9,0xd5,0x1e,0x95};
    static std::uint8_t c43[32] = {0x3a,0x9c,0xe5,0xb6,0xf7,0x20,0x7a,0xd3,0x45,0x7e,0x9d,0x0e,0xef,0x35,0xaf,0x29,0x8a,0x94,0x3d,0xb1,0x4a,0x64,0xa5,0x66,0x2f,0xb0,0x8a,0xab,0xe2,0x40,0x4b,0x2f};
    sm9_fn_from_bytes(a, a43);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c43, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a44[32] = {0x3e,0xbd,0x11,0xd2,0xac,0x27,0x16,0xdf,0xd1,0x78,0x35,0x21,0x00,0x6e,0x2c,0x3e,0x70,0xce,0xea,0xd8,0xc9,0x35,0x78,0x25,0x33,0xc0,0xbc,0x91,0x06,0x58,0x17,0xfd};
    static std::uint8_t c44[32] = {0x29,0x37,0x2f,0x36,0x60,0x57,0x51,0x91,0x09,0x4c,0xb0,0x1d,0xdd,0x12,0xe2,0xef,0x52,0xce,0x71,0x26,0xeb,0x16,0xfd,0xb8,0x18,0x22,0x5e,0xc0,0x03,0xe2,0xf5,0x8e};
    sm9_fn_from_bytes(a, a44);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c44, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a45[32] = {0x44,0x20,0x3e,0x46,0xee,0x2a,0x01,0x8d,0x09,0xf4,0x02,0xd2,0xdc,0x47,0xb9,0xee,0x07,0x6a,0x21,0x52,0x9a,0x52,0xa8,0xc7,0xf0,0x30,0xe3,0x59,0x50,0xf4,0xf5,0x9b};
    static std::uint8_t c45[32] = {0x00,0x43,0xc5,0x21,0x5c,0x5a,0x5c,0xda,0x31,0x66,0x7b,0xb0,0x98,0x66,0x44,0x44,0x04,0xce,0x52,0x2f,0xc4,0x48,0xdb,0x72,0x4a,0xfb,0xf1,0x07,0x41,0xb2,0x5f,0x9b};
    sm9_fn_from_bytes(a, a45);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c45, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a46[32] = {0x41,0x10,0x04,0xa9,0xc1,0xf2,0x46,0xe4,0xe0,0xcb,0x20,0x02,0x53,0x4f,0xd9,0x5f,0xe2,0x80,0xe5,0x81,0xff,0x2b,0x16,0x69,0x25,0xc1,0x99,0xd0,0x57,0x77,0x7d,0x8c};
    static std::uint8_t c46[32] = {0x02,0xdf,0xf7,0x4d,0x9f,0x73,0x30,0x05,0x30,0x54,0x99,0x05,0x5d,0xf5,0xfc,0xc6,0x4a,0xdf,0x82,0x12,0x1e,0xbc,0x95,0x49,0x06,0x62,0x4f,0x99,0x63,0x2e,0x0c,0xed};
    sm9_fn_from_bytes(a, a46);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c46, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a47[32] = {0x3a,0xc7,0x84,0x0e,0xd3,0x78,0x49,0x16,0xb7,0xe7,0x96,0xf6,0x96,0x4d,0xcb,0x9f,0xd9,0xde,0x8c,0xe4,0x61,0xa8,0x79,0xd8,0x8c,0x9c,0x51,0xce,0xb0,0x71,0xea,0x95};
    static std::uint8_t c47[32] = {0x0e,0x47,0x4b,0x29,0x2a,0x9e,0x69,0xa6,0x72,0x9b,0x37,0x9c,0xb3,0x64,0x03,0xb4,0x35,0xe0,0x38,0x8c,0x46,0xd6,0x17,0xc6,0x8e,0x44,0xe7,0x10,0x97,0x0c,0x33,0xba};
    sm9_fn_from_bytes(a, a47);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c47, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a48[32] = {0x83,0x6a,0x09,0x3b,0x98,0x1c,0x24,0x7e,0x04,0x5e,0x1f,0x53,0xe9,0x47,0x51,0x7b,0x7b,0x87,0x99,0x48,0xa5,0x63,0xdc,0x85,0xbb,0x78,0xa2,0x92,0xfd,0xda,0xd5,0x10};
    static std::uint8_t c48[32] = {0x41,0x4c,0x00,0x19,0x23,0xca,0x9b,0x32,0xe7,0x9a,0xa6,0x8f,0xb5,0x24,0x03,0xd1,0xc0,0x00,0x65,0x27,0x62,0x1d,0x52,0x2c,0x8d,0xb2,0x31,0x8c,0x45,0x47,0x07,0xef};
    sm9_fn_from_bytes(a, a48);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c48, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a49[32] = {0x46,0x53,0x72,0xdb,0x5e,0xbc,0xf8,0xb4,0xbf,0x51,0x47,0x75,0x49,0xf4,0xa8,0xf5,0xae,0xff,0x6a,0x47,0x1d,0xe9,0x45,0x1a,0x7c,0x68,0x5c,0xf0,0xb5,0x27,0xc4,0x0b};
    static std::uint8_t c49[32] = {0x12,0x18,0xe7,0x9a,0x68,0x47,0xa0,0xb3,0x73,0x91,0x4a,0x12,0x45,0xe1,0x21,0x55,0x92,0x83,0x11,0x4c,0xf1,0x96,0x41,0xb9,0xb2,0xa4,0xb8,0x81,0x86,0x55,0xda,0xaf};
    sm9_fn_from_bytes(a, a49);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c49, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a50[32] = {0x12,0x68,0xfa,0x69,0xaa,0xe6,0x90,0x3c,0x11,0x07,0x16,0xfd,0xdb,0xc8,0x46,0xd0,0x7a,0x36,0xe2,0x6b,0x14,0x44,0xf5,0x5f,0xd0,0x7b,0xc6,0xd2,0x4b,0x86,0x43,0x13};
    static std::uint8_t c50[32] = {0x2b,0xaa,0x25,0x91,0x68,0x28,0xee,0xbe,0x56,0xb2,0xf4,0xfd,0x1a,0xc6,0x85,0x6d,0x18,0x36,0x95,0xb6,0xfc,0xe9,0x96,0x54,0x00,0xdf,0x01,0x46,0xb6,0x64,0x21,0x8b};
    sm9_fn_from_bytes(a, a50);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c50, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a51[32] = {0x8c,0xda,0x32,0x3d,0x75,0xbd,0x6e,0x86,0x40,0x47,0x66,0xcb,0xd0,0x79,0xfb,0x0a,0x1b,0x95,0x58,0x63,0x48,0x7d,0x8c,0x3c,0x7d,0xcf,0xdd,0x9d,0x0d,0xf5,0xd3,0x33};
    static std::uint8_t c51[32] = {0x44,0x13,0xed,0x34,0x09,0x44,0x28,0x0b,0xc3,0xd4,0x19,0x73,0x84,0xcf,0x47,0x15,0x36,0xc8,0x57,0xa8,0xd4,0xe2,0x52,0xa9,0xe9,0x80,0x37,0x7e,0x79,0x00,0x30,0x77};
    sm9_fn_from_bytes(a, a51);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c51, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a52[32] = {0x98,0xec,0xc5,0xde,0xf2,0x95,0x88,0x87,0xb6,0x50,0xda,0x6a,0x6e,0x2b,0x30,0x8c,0x26,0x7a,0xd4,0xe5,0xfa,0xf0,0x77,0x90,0x45,0x5a,0xed,0xf7,0xcf,0x1e,0x78,0xcd};
    static std::uint8_t c52[32] = {0xa3,0xd4,0x42,0xcb,0x8a,0x0a,0x6e,0x22,0x42,0x08,0xd3,0x43,0xe3,0x84,0xa3,0x95,0xe3,0xf5,0x44,0x1f,0x73,0x2e,0xb6,0x9c,0xc7,0x72,0xf9,0x68,0x27,0x5c,0x24,0x7d};
    sm9_fn_from_bytes(a, a52);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c52, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a53[32] = {0x5d,0x12,0x31,0x5d,0x1d,0x76,0x18,0x58,0x12,0x17,0x82,0x80,0x07,0x42,0x81,0x5c,0x4b,0x6f,0x73,0xb6,0x4d,0x67,0x22,0x54,0x77,0x78,0x1a,0x61,0xd1,0xcd,0x02,0xce};
    static std::uint8_t c53[32] = {0x21,0xa7,0x3d,0x77,0x4b,0x1c,0x9d,0x7c,0xa1,0x3f,0x77,0x89,0x1e,0x61,0x01,0x07,0x00,0x95,0x0a,0xb8,0xd0,0x4c,0x86,0x94,0x9b,0xd1,0x65,0x51,0xa4,0xca,0x9a,0x15};
    sm9_fn_from_bytes(a, a53);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c53, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a54[32] = {0x99,0xd7,0x68,0xfd,0xed,0xea,0xf4,0x47,0xf1,0x27,0xfd,0x6e,0xad,0x4d,0xdd,0x25,0x27,0xe3,0xf8,0x8d,0x31,0xb6,0x3b,0xf1,0x56,0xb7,0xaf,0xd9,0x29,0x4e,0xa1,0x4c};
    static std::uint8_t c54[32] = {0x41,0x68,0x0c,0xde,0x6c,0xb9,0xa2,0xa6,0x39,0xd7,0x3e,0x03,0xd8,0xa6,0x63,0x07,0x0c,0xaf,0x22,0xdb,0x32,0x8b,0x37,0x47,0x71,0x26,0x50,0x27,0x00,0x12,0x0b,0xad};
    sm9_fn_from_bytes(a, a54);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c54, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a55[32] = {0x12,0xc8,0xc8,0x1b,0x67,0x71,0x5b,0x25,0x72,0x59,0x96,0x1a,0xc0,0x4d,0x09,0x31,0xb8,0xe2,0x2f,0x7a,0xeb,0xe6,0xf5,0x1c,0xea,0x57,0xb5,0x68,0x80,0x3b,0x8d,0xd4};
    static std::uint8_t c55[32] = {0x1b,0xbc,0xb5,0x26,0x1b,0x42,0xa7,0xdd,0xff,0x7d,0xb1,0x93,0xd6,0x18,0x96,0x5d,0x3c,0xfc,0xf5,0x3f,0xad,0x0e,0xa7,0x1f,0xfb,0xb1,0x7c,0x2e,0x5e,0xdc,0xb3,0x5b};
    sm9_fn_from_bytes(a, a55);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c55, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a56[32] = {0x60,0x57,0x7b,0xe7,0xc0,0xb8,0xf4,0x7f,0xd0,0x9a,0x9c,0xb8,0xd7,0x31,0xd1,0x77,0x70,0x6f,0xea,0x11,0xb0,0x0a,0x44,0x63,0xea,0xf3,0x19,0xfd,0x06,0x87,0x78,0xca};
    static std::uint8_t c56[32] = {0x92,0xae,0x36,0x0f,0x25,0x43,0xb5,0xb1,0xc0,0xbe,0x54,0x6a,0x54,0x7a,0x54,0xd4,0x02,0x80,0xf2,0x1e,0x0b,0xd9,0x07,0x0d,0x9f,0x1a,0x14,0x3f,0x51,0x93,0x69,0x9f};
    sm9_fn_from_bytes(a, a56);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c56, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a57[32] = {0x2c,0x8c,0x03,0xe2,0x6c,0xd1,0xae,0x93,0x7c,0xfe,0x24,0xb3,0xc3,0xaa,0xb3,0xf2,0x0d,0xf8,0xf6,0xe2,0x7d,0x82,0x9a,0x15,0xbe,0x62,0x2f,0x7e,0xec,0x2e,0x0d,0x79};
    static std::uint8_t c57[32] = {0x4f,0xc9,0xf5,0x24,0xde,0xca,0x9e,0xbf,0x57,0x05,0x44,0xd9,0xa6,0x71,0x56,0x41,0xd1,0x6e,0xf2,0x30,0x59,0xc0,0x56,0x3f,0xcc,0x35,0x47,0xd3,0x7a,0x73,0x75,0x19};
    sm9_fn_from_bytes(a, a57);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c57, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a58[32] = {0xaa,0x90,0xf9,0x84,0xd2,0x99,0x4a,0x24,0xb4,0x7e,0xeb,0x59,0xe8,0xff,0x5f,0x04,0x44,0xe2,0x50,0x17,0xd1,0xc9,0xc0,0x5e,0x5f,0xc9,0x50,0x3c,0x26,0x11,0x8c,0x24};
    static std::uint8_t c58[32] = {0x2b,0xde,0x73,0x98,0xa0,0xd2,0x18,0x22,0xc1,0xe0,0x04,0x61,0x6e,0xfd,0x8e,0xcf,0x96,0x49,0x27,0x75,0xd1,0x06,0xfa,0x38,0x6b,0x3d,0xd1,0x88,0xf8,0x75,0x12,0x5d};
    sm9_fn_from_bytes(a, a58);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c58, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a59[32] = {0x31,0xed,0x41,0x6b,0xaa,0x3d,0xbb,0x92,0x7c,0x31,0xe1,0x1a,0xec,0x8d,0x14,0x13,0xe8,0xb8,0xca,0xe8,0x60,0x3d,0x14,0x2e,0xcf,0x7e,0x67,0x60,0x95,0x67,0x47,0x31};
    static std::uint8_t c59[32] = {0x5f,0x18,0xfa,0x39,0xcc,0x54,0x07,0x19,0x5f,0xfc,0x5a,0xcd,0x37,0xac,0xcc,0x03,0x42,0xa2,0xf9,0x88,0xa5,0xeb,0x8b,0x24,0x8e,0x13,0x9a,0x89,0xf5,0x20,0x02,0x4c};
    sm9_fn_from_bytes(a, a59);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c59, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a60[32] = {0x34,0x5b,0x96,0x9c,0x36,0xe2,0x23,0x6c,0x33,0x26,0x3b,0xfd,0x65,0x77,0xbd,0xa1,0x00,0xfd,0xaf,0x6f,0x0c,0x38,0xb3,0x8f,0x0a,0x73,0x67,0x28,0xa6,0x92,0x52,0x75};
    static std::uint8_t c60[32] = {0x2a,0xaa,0xbe,0x89,0xb9,0x08,0x6a,0xb2,0xca,0xe4,0xc2,0x90,0xfd,0x67,0x06,0xb3,0xcb,0x3c,0xca,0x0b,0xe6,0x37,0x8c,0x2a,0x20,0x65,0xf6,0xa5,0xd1,0xe4,0xc7,0x3d};
    sm9_fn_from_bytes(a, a60);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c60, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a61[32] = {0x1e,0x1d,0x3f,0x23,0xed,0x4a,0xc1,0x82,0x5a,0x8c,0x23,0x52,0x10,0xc6,0x4e,0x10,0xb7,0x62,0x71,0xf7,0xda,0xc0,0x4c,0x79,0x9b,0x3b,0xd8,0x84,0xb8,0x0e,0xd4,0x80};
    static std::uint8_t c61[32] = {0x46,0xd6,0xd2,0x51,0x8f,0x04,0xb1,0xf4,0xb8,0xa5,0x84,0x48,0xce,0x68,0x8a,0x3a,0xdb,0xff,0xce,0xff,0xc0,0x22,0x72,0xab,0x0a,0x7f,0x3e,0x93,0x1d,0xb3,0x56,0x5a};
    sm9_fn_from_bytes(a, a61);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c61, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a62[32] = {0x43,0xe9,0x96,0x93,0x02,0xc9,0xf4,0x53,0xf9,0x6c,0x9f,0x6d,0x87,0x3b,0xb0,0x21,0x03,0xb6,0x37,0x17,0xcd,0x06,0x35,0xc8,0x4f,0xb3,0x21,0x82,0x02,0x15,0x1e,0xef};
    static std::uint8_t c62[32] = {0xb4,0xfc,0xcc,0x64,0x7b,0xab,0x6b,0x9d,0x28,0xe7,0x12,0x68,0xa0,0xdf,0xe2,0x45,0xf3,0x30,0x63,0x04,0x45,0xef,0xbc,0xd4,0x7e,0x7f,0x3a,0x6c,0x7e,0x9b,0x0e,0xcf};
    sm9_fn_from_bytes(a, a62);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c62, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a63[32] = {0x63,0xa7,0x8c,0xfe,0xac,0x52,0x49,0xc3,0x3c,0x36,0x92,0x5d,0x1e,0xc9,0xa3,0x8a,0xfe,0x7a,0x30,0x30,0xef,0xad,0xe2,0xc8,0xd1,0xb5,0xb9,0xf5,0xe4,0xc5,0xb6,0x14};
    static std::uint8_t c63[32] = {0x8c,0x1f,0x56,0xbf,0x8a,0x05,0x34,0x82,0x14,0x75,0xc7,0x4d,0x43,0xf7,0x90,0x10,0xeb,0x51,0xf7,0x1e,0xe0,0x2d,0x89,0xa3,0xec,0xc2,0x72,0x61,0x87,0x93,0xa1,0xa1};
    sm9_fn_from_bytes(a, a63);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c63, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a64[32] = {0x37,0x3c,0x51,0x5d,0x3f,0xbf,0x5f,0x4e,0x44,0xe2,0x90,0xe4,0xfa,0xde,0x2d,0xeb,0x04,0x3f,0x45,0x5a,0x04,0x49,0xad,0x87,0x0c,0xb0,0x44,0x52,0xf7,0x01,0xa4,0x62};
    static std::uint8_t c64[32] = {0x25,0xae,0xd2,0xa8,0x8e,0xbb,0x79,0x19,0x48,0x0a,0xb0,0x91,0x49,0x6f,0xe3,0x7b,0x77,0xcc,0x1b,0x31,0x27,0x78,0x36,0xb4,0x25,0x37,0x05,0x83,0x5e,0xf2,0x74,0x97};
    sm9_fn_from_bytes(a, a64);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c64, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a65[32] = {0x0e,0x4e,0x64,0x12,0xe3,0x90,0x30,0x8e,0x68,0xa8,0xb2,0x9e,0x78,0x96,0x65,0xa9,0x71,0x7b,0x5c,0xbc,0x43,0x2b,0xc1,0x8d,0xe1,0x28,0x61,0x61,0x5c,0x3f,0xc8,0x40};
    static std::uint8_t c65[32] = {0x4c,0xf6,0xe9,0x29,0x74,0xa3,0x06,0x68,0xb9,0x75,0xf5,0xcd,0xf4,0x4a,0xb5,0x9e,0xc5,0xc3,0x30,0xe1,0xfa,0x2f,0x12,0x67,0xea,0xea,0x00,0x96,0x4e,0x25,0xa1,0x57};
    sm9_fn_from_bytes(a, a65);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c65, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a66[32] = {0x3d,0x45,0x7b,0x79,0x86,0x19,0x92,0xff,0xb4,0x6a,0x41,0x8b,0x15,0x58,0xce,0x72,0x2f,0xcb,0x16,0xf9,0x41,0x7e,0x88,0xf1,0x78,0x08,0x2d,0x1c,0x9b,0x85,0xa4,0x34};
    static std::uint8_t c66[32] = {0x5d,0xf6,0x30,0xe0,0xb9,0xfa,0x97,0xda,0x83,0x6f,0x5a,0xab,0x4e,0x30,0x9c,0xba,0xc3,0x93,0x01,0xd2,0xee,0xc1,0x21,0x67,0x9e,0xb2,0xc1,0xd5,0x65,0xa5,0x95,0x40};
    sm9_fn_from_bytes(a, a66);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c66, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a67[32] = {0x0f,0x5d,0xfe,0x05,0xb1,0x4e,0x8a,0xb4,0xab,0x3c,0x96,0x59,0x41,0xaf,0xc2,0xa9,0x02,0x06,0x37,0x0d,0xb2,0x83,0x5c,0x2e,0x86,0xaf,0x2f,0xa3,0xe8,0x6e,0x4b,0x90};
    static std::uint8_t c67[32] = {0x16,0x44,0x4f,0x14,0xce,0x6d,0xc5,0x49,0x93,0xc9,0x38,0xb6,0x56,0xcc,0x8c,0x0e,0x23,0x85,0x4b,0x44,0x9e,0x0c,0x75,0x1c,0x9f,0x13,0xca,0x23,0xf9,0xeb,0x6a,0xc1};
    sm9_fn_from_bytes(a, a67);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c67, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a68[32] = {0x32,0xd3,0xee,0x6a,0x2e,0x50,0xb7,0x89,0x9c,0xd6,0x40,0x1b,0x3f,0x85,0xaa,0x94,0x53,0xac,0xc2,0x55,0x7d,0xb1,0x15,0xa7,0xd4,0xcd,0xa4,0xf1,0xcc,0xcc,0x58,0x4a};
    static std::uint8_t c68[32] = {0x70,0x1e,0x4e,0xa7,0x85,0xc3,0xb8,0x40,0x69,0x51,0x02,0x41,0x27,0x7e,0x0c,0x82,0x10,0xa2,0x95,0xfe,0xd7,0x20,0xaf,0x0b,0xa3,0xe4,0x37,0x15,0xd8,0xdd,0xa9,0xbb};
    sm9_fn_from_bytes(a, a68);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c68, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a69[32] = {0x41,0x56,0xb5,0xc4,0xfb,0xcf,0x92,0x2b,0x76,0x02,0x97,0xb1,0xde,0x75,0xd7,0x92,0xd5,0xe0,0xce,0xa3,0x15,0xba,0xcd,0xf2,0x10,0xd9,0x7c,0xa2,0x4b,0xcc,0x60,0x5b};
    static std::uint8_t c69[32] = {0x4b,0xe2,0x81,0xaa,0x5b,0x8e,0x52,0x4a,0xa9,0xfb,0xb7,0xea,0xeb,0x42,0x0c,0xf8,0x44,0x03,0x94,0x8a,0x69,0x7a,0xb9,0xda,0xb4,0x9b,0xfe,0xaa,0x21,0x70,0xf3,0x9f};
    sm9_fn_from_bytes(a, a69);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c69, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a70[32] = {0x93,0x17,0xb5,0x2d,0xd2,0x69,0xfa,0xa9,0x0e,0x8c,0xda,0x0c,0x67,0x8b,0x54,0x13,0xbe,0x39,0xae,0xa3,0x64,0x76,0xe3,0x77,0x0d,0x98,0x13,0x42,0x67,0x07,0x94,0x6c};
    static std::uint8_t c70[32] = {0xae,0x6b,0x90,0xcd,0x80,0x48,0xa8,0xbd,0x4e,0xa3,0x52,0x27,0x83,0x40,0xa4,0xe2,0x5b,0x57,0xdc,0x8b,0xd0,0x0d,0x5f,0x35,0x65,0xf4,0x95,0x89,0x5e,0x3e,0x67,0xb0};
    sm9_fn_from_bytes(a, a70);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c70, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a71[32] = {0x57,0xb5,0x6c,0x72,0xdf,0x3e,0x07,0xfb,0xe8,0x07,0x1a,0x1f,0x35,0x79,0xec,0xbf,0xbb,0x65,0x73,0xc2,0x91,0x68,0x71,0x32,0x17,0x3a,0x56,0x95,0x5a,0x72,0xfd,0x13};
    static std::uint8_t c71[32] = {0x55,0xbf,0x4d,0x0b,0xff,0xf4,0xfe,0x6e,0xa5,0xf5,0x9e,0xf3,0x88,0xc3,0x67,0x6e,0x1e,0x07,0x40,0x34,0x23,0xc9,0xec,0x8d,0xd9,0x50,0x25,0x60,0x06,0xb0,0x3d,0x32};
    sm9_fn_from_bytes(a, a71);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c71, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a72[32] = {0x37,0xc4,0xd0,0x71,0x03,0x2e,0xcd,0x04,0xc3,0x0e,0xf8,0xbc,0x73,0x23,0xa3,0x67,0xff,0x88,0x69,0x58,0xe5,0x8b,0x9b,0xf0,0x10,0x52,0xba,0x78,0xdf,0x1e,0xcf,0xc3};
    static std::uint8_t c72[32] = {0xa8,0x35,0x1c,0x4e,0x9c,0xfc,0x3a,0xaa,0xa1,0x58,0x06,0xd3,0xdb,0x73,0xb9,0x3e,0xc3,0x99,0xe6,0x62,0x8c,0xfe,0xff,0x60,0x7c,0x4b,0x9f,0x58,0x5d,0x9f,0x7b,0x76};
    sm9_fn_from_bytes(a, a72);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c72, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a73[32] = {0x85,0xd6,0xee,0x26,0xc5,0x44,0x56,0x62,0xe4,0xff,0x0a,0x9e,0x50,0x4c,0xe1,0x47,0xdc,0xca,0xc5,0xbb,0xbd,0x00,0xa5,0xc0,0xfb,0xbd,0x0b,0x17,0x67,0x5c,0x7a,0x9c};
    static std::uint8_t c73[32] = {0x18,0xcc,0x3f,0xef,0x75,0xb1,0x37,0x8e,0xf8,0xb5,0x36,0x22,0x7a,0xe2,0xe3,0x61,0xee,0xc2,0x3b,0xf9,0x3d,0xdf,0x0f,0x8e,0x4e,0x23,0xf8,0xd6,0xaa,0xf9,0xd5,0x63};
    sm9_fn_from_bytes(a, a73);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c73, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a74[32] = {0x34,0xa8,0x34,0x8e,0xa8,0x8d,0xad,0x81,0x92,0xff,0xce,0x41,0x52,0x3b,0xa6,0x64,0x1c,0x05,0x57,0x0b,0xf5,0x01,0x71,0x95,0xf2,0xc9,0x72,0xe5,0x06,0x7a,0x92,0xd9};
    static std::uint8_t c74[32] = {0x91,0xc5,0x1c,0xce,0xc8,0xb8,0x15,0x7e,0xe7,0x72,0x24,0x03,0x2c,0xa1,0xc0,0xd3,0xee,0x28,0x35,0xd1,0x99,0x25,0xed,0x5f,0x89,0xd3,0xf2,0xd5,0xb3,0x6c,0xe5,0x2f};
    sm9_fn_from_bytes(a, a74);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c74, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a75[32] = {0x8f,0x80,0x3c,0xb8,0xee,0x58,0xed,0xc3,0xe5,0x48,0x76,0xa7,0x95,0x87,0x07,0x74,0x9e,0x42,0x36,0x71,0x13,0x11,0x09,0xdb,0xc7,0x45,0x12,0x8e,0xf2,0xbe,0xa1,0x2a};
    static std::uint8_t c75[32] = {0x00,0xee,0x61,0xec,0xdb,0x95,0x22,0xa7,0xa5,0x67,0xd7,0xa3,0x25,0x7b,0xcb,0x1f,0xd5,0xed,0x87,0x18,0x18,0x43,0x14,0x52,0xb4,0x33,0xfe,0x0d,0x5f,0x81,0xb5,0x77};
    sm9_fn_from_bytes(a, a75);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c75, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a76[32] = {0x38,0x9f,0x3e,0x26,0xa2,0x6b,0xee,0x18,0x11,0x35,0xec,0xd1,0x35,0x33,0xdb,0xd3,0xee,0x40,0xfa,0x55,0x9d,0xa7,0x20,0xdf,0x51,0xca,0x6c,0xa3,0x92,0xe6,0x38,0xfd};
    static std::uint8_t c76[32] = {0x61,0x11,0x09,0xf1,0x31,0xca,0x5b,0xd3,0x3a,0x33,0x76,0xba,0x86,0x73,0x5c,0xb2,0xa8,0xa3,0x2f,0x28,0x16,0x5e,0x63,0x3f,0x5e,0x94,0x7b,0x2d,0x58,0x13,0x6e,0xef};
    sm9_fn_from_bytes(a, a76);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c76, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a77[32] = {0x93,0x4f,0xb8,0xfc,0xc7,0x2c,0x47,0xcc,0x9a,0x23,0x73,0x91,0x27,0x26,0x8c,0x6f,0x3f,0x08,0x5b,0xf3,0xab,0x46,0xe2,0x08,0x06,0xe0,0x85,0xd4,0x7d,0x12,0xe3,0x27};
    static std::uint8_t c77[32] = {0x57,0x57,0x63,0x69,0x37,0x95,0x68,0x2a,0x4d,0x1b,0x5d,0x48,0xfd,0x70,0x93,0x98,0x2d,0x23,0x87,0x9f,0x6d,0x06,0xf6,0xbf,0xbe,0x5a,0xc5,0x20,0xec,0x9b,0x66,0xa7};
    sm9_fn_from_bytes(a, a77);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c77, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a78[32] = {0x25,0x92,0x2d,0xf8,0x8a,0x10,0xde,0x69,0xd1,0x89,0xfb,0xa6,0x9b,0x7a,0xe3,0xfb,0xf3,0xab,0xbd,0x41,0xb9,0xd7,0x38,0xe4,0x22,0x0b,0xd8,0x17,0x74,0xf6,0x81,0x5f};
    static std::uint8_t c78[32] = {0x39,0xf3,0x53,0x4f,0xff,0xf9,0xb2,0x17,0xd8,0xb4,0x66,0x93,0x02,0x24,0x4e,0xec,0x6e,0xdb,0x9c,0x16,0xcc,0x71,0x44,0xb1,0xe8,0x92,0xe4,0x58,0x81,0x88,0xf6,0x24};
    sm9_fn_from_bytes(a, a78);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c78, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a79[32] = {0x2e,0x95,0xe4,0xd4,0x32,0xa9,0xb2,0xff,0x48,0x05,0x0d,0x0c,0xc2,0xed,0x98,0x4d,0x79,0x11,0x97,0x6c,0xd9,0x29,0x5c,0xdf,0x36,0x11,0x44,0x1c,0x88,0x04,0xc0,0x09};
    static std::uint8_t c79[32] = {0x18,0xdd,0x4a,0xd0,0x26,0xbb,0x47,0xfc,0xd2,0xcd,0xc1,0x6f,0x5a,0xf0,0xfd,0xbc,0x52,0xc8,0xd0,0x00,0xfc,0x13,0x2e,0x5b,0x1f,0x62,0x9d,0x7e,0xcb,0x56,0xe7,0x91};
    sm9_fn_from_bytes(a, a79);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c79, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a80[32] = {0x40,0x1b,0x95,0xd6,0x7c,0x4e,0x24,0xf7,0x01,0xc0,0x62,0xb6,0x80,0x44,0xf0,0x20,0x5e,0x03,0x41,0xeb,0x52,0xdf,0x01,0xbe,0xc3,0x67,0xdb,0xa4,0x7c,0x6f,0xa7,0xff};
    static std::uint8_t c80[32] = {0x38,0xff,0x7a,0x6d,0x9f,0x9c,0x0b,0x84,0xa3,0x93,0x54,0xd7,0x2b,0xbf,0x58,0x00,0x29,0x4f,0xee,0x3a,0xc7,0x28,0x9d,0xe0,0x8e,0x64,0x75,0x51,0xc3,0x6e,0x29,0x8b};
    sm9_fn_from_bytes(a, a80);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c80, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a81[32] = {0x08,0x21,0x94,0x68,0xe1,0xaf,0x41,0x88,0xdd,0x5e,0xa5,0x28,0x13,0xcf,0x36,0x3c,0xa4,0x72,0xf3,0x24,0xc6,0x37,0xf2,0x70,0x9b,0x58,0x0e,0x44,0x40,0x9e,0x69,0x1e};
    static std::uint8_t c81[32] = {0x47,0x22,0x2c,0x17,0xaa,0x64,0x8b,0x87,0x4c,0xb8,0x36,0xd9,0x7c,0x12,0xb3,0x8a,0xa0,0xaf,0xe4,0x2a,0xe8,0x57,0x6a,0xdf,0x0a,0xd3,0xa0,0x38,0x83,0x3a,0xdd,0x09};
    sm9_fn_from_bytes(a, a81);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c81, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a82[32] = {0x6a,0xc1,0xf4,0xe7,0xe2,0x23,0x68,0x00,0x2d,0xee,0x52,0x7f,0xfc,0x13,0x08,0xfc,0x27,0x69,0xe7,0xc3,0xfc,0x51,0x25,0x3c,0x56,0x71,0xcb,0x13,0x70,0x8c,0x96,0x0b};
    static std::uint8_t c82[32] = {0x51,0xe4,0x46,0x52,0xd9,0x36,0x53,0x8a,0x32,0xc9,0xca,0xf3,0x0a,0x6c,0xcd,0xbe,0xcb,0xd4,0x9f,0xab,0x8f,0x12,0xb7,0x2e,0xd7,0x84,0xf1,0xda,0xaa,0xa6,0x0c,0xb5};
    sm9_fn_from_bytes(a, a82);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c82, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a83[32] = {0x49,0x20,0x0e,0xd2,0xdd,0x55,0xa0,0x76,0x6c,0x88,0x1a,0x43,0xd2,0xac,0x2e,0x67,0x65,0xf4,0x8f,0xd8,0x31,0x16,0xf9,0xa5,0xc5,0xfa,0x51,0xec,0xe1,0x60,0x95,0xd6};
    static std::uint8_t c83[32] = {0x91,0x6f,0xcc,0x47,0xd0,0x38,0x05,0xf1,0xa9,0x7a,0xd3,0x39,0x5d,0x0e,0x9f,0xdb,0x2d,0x4f,0x18,0x92,0x20,0xbe,0x41,0x92,0xd0,0x0d,0xb2,0xec,0xcd,0xab,0x17,0x93};
    sm9_fn_from_bytes(a, a83);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c83, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a84[32] = {0x07,0x4d,0xaf,0xdf,0xa5,0x94,0x4f,0x2d,0xc0,0x44,0x49,0x46,0x45,0xc3,0x27,0x36,0x49,0xe2,0xb8,0xe3,0x57,0xe4,0x21,0x9e,0xd0,0xd5,0x68,0x54,0x04,0xde,0x39,0x6a};
    static std::uint8_t c84[32] = {0x7b,0xe4,0x4b,0x01,0xd2,0xe1,0x78,0x58,0xae,0x8a,0x51,0x8b,0xe0,0x9b,0xc9,0x52,0xf3,0x6b,0x44,0x33,0x4e,0xf1,0x8b,0xfd,0x40,0xfe,0x6d,0x62,0x69,0xbd,0xbe,0x4d};
    sm9_fn_from_bytes(a, a84);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c84, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a85[32] = {0xac,0xfa,0x2b,0x6c,0x6d,0x3f,0x7e,0x7e,0x90,0xfc,0xab,0x40,0xe8,0x07,0x34,0x62,0xbd,0xdd,0xbe,0x6b,0x6d,0x0b,0xa4,0x60,0xfc,0x75,0xe7,0x1a,0x7a,0x8e,0x38,0x6b};
    static std::uint8_t c85[32] = {0xa4,0x90,0x1c,0xa1,0x19,0xe3,0xfa,0x5d,0x00,0x2b,0x2f,0x58,0x40,0xef,0x99,0xa7,0x6d,0xb2,0xce,0xf7,0x05,0x8f,0x23,0xca,0x69,0x1d,0xd7,0xa1,0x81,0x52,0x10,0xbc};
    sm9_fn_from_bytes(a, a85);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c85, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a86[32] = {0x2c,0x90,0x85,0x51,0x56,0xf6,0x5c,0xb9,0x1b,0x1f,0x29,0xa0,0x18,0xd0,0x3f,0xd1,0x34,0x62,0xce,0x2b,0xf1,0x4e,0xc4,0x29,0xdf,0x63,0x39,0xde,0x69,0x50,0x83,0xb3};
    static std::uint8_t c86[32] = {0xab,0x16,0xb1,0x9f,0x1a,0x9c,0xda,0x3a,0x0c,0x08,0xf2,0xa9,0x5f,0xb7,0x4f,0xcf,0x7e,0xa1,0xfe,0xf2,0x95,0x6c,0x9c,0x4e,0x2e,0x13,0x18,0x0c,0xff,0xfd,0x1f,0x6f};
    sm9_fn_from_bytes(a, a86);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c86, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a87[32] = {0x8c,0x2e,0x31,0x77,0x51,0x9f,0xbd,0x06,0x16,0x93,0xdc,0xd1,0x39,0xf2,0xa2,0x67,0xd6,0xe5,0x4c,0xc4,0xf0,0x82,0x26,0x04,0x8f,0x30,0xc0,0x0b,0x58,0xd4,0x88,0x67};
    static std::uint8_t c87[32] = {0x4e,0xa5,0x77,0xc1,0x55,0x17,0xfc,0xa8,0x67,0x9b,0x45,0x36,0x0b,0x67,0x5b,0xb4,0xf6,0xa2,0x9f,0x46,0x6f,0x01,0x74,0x90,0xc2,0xd5,0x6d,0x70,0xe4,0x71,0x57,0x87};
    sm9_fn_from_bytes(a, a87);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c87, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a88[32] = {0x42,0x69,0x29,0xc1,0xad,0xca,0xcd,0x3e,0xd7,0xbd,0x98,0x01,0xc4,0xaf,0x51,0x99,0xf5,0xbb,0x99,0x03,0x83,0x36,0x6b,0x53,0x73,0x09,0x79,0x33,0x3e,0x3a,0xfc,0xcb};
    static std::uint8_t c88[32] = {0xa4,0xc8,0x4d,0xb1,0x45,0x65,0x4d,0x54,0x89,0x26,0x04,0x25,0xd9,0x17,0x3d,0xe4,0xab,0xac,0x46,0x0e,0xde,0xbb,0x69,0x7a,0x64,0xa2,0xaa,0x76,0xab,0xae,0xcc,0x2b};
    sm9_fn_from_bytes(a, a88);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c88, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a89[32] = {0x53,0x74,0xc8,0x5e,0x5b,0x89,0x0f,0x1a,0x3c,0xe9,0x36,0x45,0x16,0xeb,0x01,0x47,0x8f,0x57,0xcf,0x88,0x6c,0xb7,0xc4,0x2c,0x52,0xd4,0x1b,0x04,0xb0,0xd5,0xbc,0x5b};
    static std::uint8_t c89[32] = {0x7b,0x65,0xa0,0x2e,0x84,0xbe,0xe0,0x83,0x34,0xc8,0xd5,0xc9,0x78,0x04,0xe2,0xd2,0xca,0x1b,0x73,0xd5,0x58,0x2a,0x11,0x60,0x52,0x7e,0x30,0x90,0x2f,0x1c,0xfc,0x96};
    sm9_fn_from_bytes(a, a89);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c89, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a90[32] = {0xb3,0x51,0xc6,0x87,0x6f,0xe0,0xe4,0xa6,0xdc,0x72,0x55,0x74,0x33,0xb4,0x7d,0x5e,0xbf,0x2b,0x07,0xf1,0x89,0x5b,0x5c,0xd9,0x98,0x7a,0x10,0x71,0xfd,0x41,0xdb,0x28};
    static std::uint8_t c90[32] = {0x89,0x36,0x32,0xc1,0xc4,0x7d,0x81,0xd1,0xca,0x38,0x16,0xe1,0xfc,0x15,0xa1,0x29,0x5c,0xeb,0xf0,0x94,0x40,0xe4,0xca,0x66,0x09,0x45,0x5e,0xd0,0x14,0xac,0x16,0xe5};
    sm9_fn_from_bytes(a, a90);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c90, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a91[32] = {0x28,0x29,0x7c,0x6e,0x94,0xd0,0xb4,0xbe,0x67,0x91,0x0a,0xb5,0x1b,0x5e,0x04,0xd0,0x8d,0x8d,0x8e,0xca,0xbb,0x96,0x2d,0xd3,0x1a,0xae,0xcc,0x64,0x18,0xde,0xd8,0xd9};
    static std::uint8_t c91[32] = {0x51,0x03,0xdf,0x0f,0x30,0xec,0x90,0xb7,0x8c,0x25,0x97,0xb6,0xb5,0xba,0x1a,0x87,0xab,0xb9,0xeb,0x08,0x41,0x3b,0x13,0x43,0x1e,0x2c,0x35,0x0b,0xe4,0x90,0x98,0xb3};
    sm9_fn_from_bytes(a, a91);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c91, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a92[32] = {0x09,0xd4,0x7f,0xbb,0xb9,0xb4,0xd7,0x02,0xa8,0x86,0xfe,0xbd,0xbb,0xdd,0x13,0x5f,0x75,0xd8,0x83,0xe7,0xce,0x6a,0x4b,0x0f,0x6b,0xb8,0x07,0x17,0x9d,0x78,0x9a,0x8f};
    static std::uint8_t c92[32] = {0x75,0xaa,0x1e,0x1a,0x84,0x35,0xf6,0xf4,0xc7,0x3d,0xfa,0x01,0x6b,0x88,0xf1,0x87,0x6e,0x6d,0x35,0x31,0xc4,0xed,0x3f,0x30,0x6b,0x8b,0x94,0x2b,0x4c,0x07,0x69,0xdf};
    sm9_fn_from_bytes(a, a92);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c92, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a93[32] = {0x1e,0x62,0xc2,0x32,0x74,0xa8,0x38,0x09,0x04,0x42,0x26,0xe1,0x3a,0xaa,0x2a,0xd9,0x54,0x89,0x86,0x1f,0x22,0x1a,0xea,0x22,0xd2,0xb6,0xc6,0x4c,0x1a,0x82,0xa5,0x2c};
    static std::uint8_t c93[32] = {0x83,0xf9,0x05,0xbc,0x73,0xbb,0xe9,0x2a,0xb2,0x81,0xc9,0x43,0xe5,0x41,0x43,0x51,0x4b,0x02,0xe3,0x4e,0xa9,0x59,0x6f,0x6e,0xdb,0xc2,0x8c,0xd5,0x36,0xf7,0xcf,0x78};
    sm9_fn_from_bytes(a, a93);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c93, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a94[32] = {0x41,0x63,0x2d,0x2d,0xc0,0x61,0xff,0xe1,0x20,0x1c,0x91,0xa7,0x9b,0x50,0xe6,0x77,0xbc,0x5c,0x54,0x2b,0xf8,0x0d,0xaf,0xf0,0x7e,0x72,0xb1,0x62,0x13,0xb1,0x1c,0xdb};
    static std::uint8_t c94[32] = {0x40,0x94,0xa0,0xff,0x69,0x27,0xd9,0xdb,0xbe,0x43,0x8f,0xc0,0x7c,0x6e,0x30,0x18,0x6e,0xea,0x50,0x03,0x79,0xb1,0xba,0x18,0xb4,0x19,0x52,0x3f,0x69,0x17,0x2c,0x21};
    sm9_fn_from_bytes(a, a94);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c94, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a95[32] = {0x0b,0xe2,0x1c,0x24,0x56,0xe7,0x03,0x9a,0x3b,0xeb,0xc6,0x4b,0x1e,0xd4,0xf3,0xc1,0x8b,0xa0,0xd5,0x5e,0xb1,0x47,0xb7,0x17,0xb9,0x00,0xd4,0x2d,0x8d,0x0b,0xee,0xa7};
    static std::uint8_t c95[32] = {0x59,0x9e,0xe3,0x13,0xf4,0xaf,0x23,0x43,0xe1,0xc5,0xce,0x2c,0xb5,0xee,0x26,0xf1,0xc2,0x2c,0x54,0xae,0x44,0x10,0xf9,0x37,0x10,0xc4,0x1f,0xed,0x91,0x30,0xae,0xaf};
    sm9_fn_from_bytes(a, a95);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c95, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a96[32] = {0x05,0x55,0x52,0xec,0x15,0x81,0x47,0x47,0xec,0x78,0xf1,0xdf,0xef,0x0f,0x26,0x77,0x04,0x78,0xb6,0x1b,0xe1,0x3d,0x19,0x82,0x94,0xb9,0x99,0x5d,0xe6,0x50,0x32,0xbf};
    static std::uint8_t c96[32] = {0x9e,0xdc,0xd8,0x1b,0xb4,0xf8,0x9f,0xb4,0x38,0xcb,0x1e,0x2c,0x41,0x83,0x8a,0x58,0xa6,0x04,0xd3,0x8b,0xe5,0xe2,0xdb,0x25,0xfd,0xd7,0x51,0x44,0x64,0xcb,0xc4,0x83};
    sm9_fn_from_bytes(a, a96);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c96, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a97[32] = {0x81,0xb0,0xb9,0x1b,0x28,0x9b,0xf0,0x39,0xf4,0x05,0x6d,0x2f,0x87,0xb6,0x7f,0x0b,0x81,0x33,0xeb,0xe3,0x0d,0x6e,0x9a,0x0d,0xc1,0x6b,0x13,0x11,0xda,0x50,0x7f,0xaa};
    static std::uint8_t c97[32] = {0x4e,0x13,0x13,0x07,0x72,0xa8,0xaf,0x34,0x01,0xa0,0xef,0x37,0x27,0x34,0xc8,0x8b,0x2d,0x36,0xec,0x3a,0x88,0xe9,0x2f,0x22,0xe7,0xfa,0xf0,0x00,0xc5,0x39,0x80,0xd2};
    sm9_fn_from_bytes(a, a97);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c97, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a98[32] = {0x09,0x24,0x64,0xd4,0x94,0x21,0x03,0x35,0xe2,0x18,0x75,0x64,0xe2,0xaf,0xa3,0x69,0x06,0x35,0xf8,0x7d,0x58,0xb0,0x5d,0xcd,0xea,0x53,0x0b,0x18,0xb4,0x4a,0x1a,0xa0};
    static std::uint8_t c98[32] = {0x4a,0x28,0xd7,0x15,0xce,0x7b,0x71,0x9c,0xaf,0x11,0xd8,0x04,0x7f,0x83,0xe8,0xeb,0x44,0x6d,0xe4,0x2e,0x41,0x89,0x0a,0x17,0xa5,0xcf,0x6a,0x29,0x67,0xd4,0xce,0xd2};
    sm9_fn_from_bytes(a, a98);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c98, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
    static std::uint8_t a99[32] = {0x23,0x15,0xef,0xda,0x55,0x02,0x41,0xe2,0xf6,0x01,0x3c,0x20,0xbc,0x9a,0x62,0x89,0x98,0x34,0x84,0xe2,0x67,0x1e,0x41,0x4c,0x33,0x59,0x2e,0x55,0x98,0x0e,0xf8,0x4c};
    static std::uint8_t c99[32] = {0x12,0xe5,0x21,0x91,0x28,0xe0,0x0e,0x42,0x8e,0xc2,0xae,0x7c,0xda,0x29,0x85,0xa0,0xf6,0xe4,0x54,0x26,0x78,0xfc,0x5a,0xfb,0xf3,0xbc,0x85,0xe1,0xf0,0x71,0xcd,0x56};
    sm9_fn_from_bytes(a, a99);
    sm9_fn_sqr(c, a);
    sm9_fn_to_bytes(c_data, c);
    if (std::memcmp(c99, c_data, 32) != 0)
    {
        throw std::runtime_error("err in sm9_fn_sqr");
    }
}